/*
*Copyright (c) Nikhil Jain.
*Project ICARUS, communications and 
*artificial intelligence.
*/



/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
 */
package javadrone.command.commandset;

//~--- non-JDK imports --------------------------------------------------------

import javadrone.RemoteImage;

import javadrone.command.*;

//~--- JDK imports ------------------------------------------------------------

import java.io.IOException;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Nikzzay
 */
public class VideoImageCommand extends AsynchronousCommand {
    private Mode MODE;

    public enum Mode { START, STOP, CAPTURE }

    public VideoImageCommand(long delay, Priority p, Mode MODE) {
        super(delay, p);
        this.MODE = MODE;
    }

    @Override
    public void execute(CommandExecutor ce) throws ExecutorException {
        switch (MODE) {
        case CAPTURE :
            ce.takeImage();

            return;

        case START :
            ce.startCamFeed();

            return;

        case STOP :
            ce.stopCamFeed();

            return;

        default :
            return;
        }
    }

    @Override
    public String toString() {
        return "Video Command: " + MODE.toString();
    }

    @Override
    public CommandDescriptor getDescriptor() {
        return CommandDescriptor.VIDEOIMAGE;
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
